//
//  PKPublishServices.swift
//  Panku
//
//  Created by mac on 2017/4/8.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit
import ReactiveCocoa
import ReactiveSwift
import Result
import Alamofire

class PKPublishServices: NSObject {
    
    //开始直播
    class func newLive(name:String,address:String,imageUrl:String,userId:Int,userName:String) -> SignalProducer<Any,NSError> {
        
        let url = PKUrl.LIVES_URL
        
        let parameters:[String : Any] = ["name":name,
                                         "address":address,
                                         "imgUrl":imageUrl,
                                         "userId":userId,
                                         "userName":userName]
        let headers: HTTPHeaders = ["Content-Type": "application/json"]
        let networkUtilsFactor = PKNetworkUtilsHelper.factory()
        let networkUtils = networkUtilsFactor()
        return networkUtils.request(url: url, method: .post, parameters: parameters, headers: headers)
    }
}
